//
//  LSMYMessageCell.m
//  LookScore
//
//  Created by wr on 2017/12/8.
//  Copyright © 2017年 ChongQingXunTiCompany. All rights reserved.
//

#import "LSMYMessageCell.h"

@interface LSMYMessageCell()

@property(strong,nonatomic)UILabel *titleLab;

@property(strong,nonatomic)UILabel *contentLab;

@end
@implementation LSMYMessageCell
+(LSMYMessageCell *)MYMessageTableViewCellByTableView:(UITableView *)tableView{
    LSMYMessageCell *cell=[tableView dequeueReusableCellWithIdentifier:NSStringFromClass(self)];
    if (!cell) {
        cell=[[LSMYMessageCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass(self)];
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
    }
    return cell;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addContentView];
    }
    
    return self;
}

-(void)addContentView{

    UIImageView *headImage=[[UIImageView alloc]init];
    headImage.image=[UIImage imageNamed:@"MineMessage"];
    [self.contentView addSubview:headImage];
    headImage.userInteractionEnabled=YES;
    headImage.sd_layout.leftEqualToView(self.contentView).offset(LSSpaceLeftWidth1).centerYEqualToView(self.contentView).widthIs(50).heightEqualToWidth();
    
    UILabel *titleLab=[[UILabel alloc]init];
    titleLab.text = @"通知";
    titleLab.font=LSFontSize15;
    titleLab.textColor=LSTitleGrayColor1;
    titleLab.textAlignment=NSTextAlignmentLeft;

    [self.contentView addSubview:titleLab];
    self.titleLab=titleLab;
    titleLab.sd_layout.leftSpaceToView(headImage, 5).topEqualToView(self.contentView).offset(self.contentView.centerY-5).rightEqualToView(self.contentView).offset(-LSSpaceLeftWidth1);
    
    UILabel *contentLab=[[UILabel alloc]init];
//    contentLab.text = @"尊敬的用户您好：由于您在2017-11-2...";
    contentLab.font=LSFontSize13;
    contentLab.textColor=LSTitleGrayColor2;
    contentLab.textAlignment=NSTextAlignmentLeft;
    [self.contentView addSubview:contentLab];
    self.contentLab=contentLab;
    contentLab.sd_layout.leftSpaceToView(headImage, 5).bottomEqualToView(self.contentView).offset(self.contentView.centerY+5).rightEqualToView(self.contentView).offset(-LSSpaceLeftWidth1);
    
    UIView *lineView=[[UIView alloc]init];
    lineView.backgroundColor=LSLineGrayColor;
    [self.contentView addSubview:lineView];
    lineView.sd_layout.leftEqualToView(self.contentView).bottomEqualToView(self.contentView).rightEqualToView(self.contentView).heightIs(.5f);
}

- (void)setModel:(LSMessageModel *)model{
    _model = model;
    self.contentLab.text = model.Title;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
